package com.tianhui.consignortwofei.mvp.ui.viewHolder.detail;

import android.view.ViewGroup;
import android.widget.TextView;

import com.fgs.common.utils.CommonUtil;
import com.tianhui.consignortwofei.R;
import com.tianhui.consignortwofei.mvp.model.enty.detailItem.DetailLineInfo;

import org.yczbj.ycrefreshviewlib.holder.BaseViewHolder;

/**
 * @author fgs
 * @date 2020/8/28
 * @description
 **/
public class DetailLineViewHolder extends BaseViewHolder<DetailLineInfo> {

    private TextView lineTextView;

    public DetailLineViewHolder(ViewGroup parent, int res) {
        super(parent, res);
        lineTextView = getView(R.id.item_detail_line_lineTextView);


    }

    @Override
    public void setData(DetailLineInfo data) {
        super.setData(data);
        if (data.lineHeight != 0) {
            lineTextView.setHeight((int) CommonUtil.convertPixelsToDp(data.lineHeight));
        }
        if (data.lineColor != 0) {
            lineTextView.setBackgroundColor(getContext().getResources().getColor(data.lineColor));
        }


    }
}
